import { RouteRecordRaw, createRouter, createWebHistory } from 'vue-router'

export * from './tools'
import { getModules } from './tools'

const routes = Object.entries(getModules()).map<RouteRecordRaw>(([key, module]) => ({ path: key, component: module }))
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes
})

export default router
